<div id="sidebar-1" class="sidebar">
		<div id="searchform" class = "box">
		<div id="search" class="s_wp">
		<form id="wpsearchform" action="http://www.google.com/search" method="get">
			<div id="searchbox">
			<input type="text" value="Search..." onfocus="if (this.value == 'Search...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Search...';}" name="as_q" id="searchinput" class="textfield" tabindex="12"/>
			<input name="as_sitesearch" value="{{blog.domain}}" type="hidden">
			<input id="searchsubmit" class="button" type="submit" value="" title="Search"/>
			</div>
		</form>
		</div>
		</div>
	<ul class="top-level">
		<li id="search" class="widget">
		{% include "search.html" %}
		</li>
		<li id="postbypost" class="widget widget_recent_entries">
			<h2>最近文章</h2>
			{% if blog.recentposts %}
			<ul>
			{% for entry in blog.recentposts %}
				<li><a href="/{{entry.link|escape}}" title="{{entry.title|escape}}">{{entry.title|escape}}({{entry.readtimes}})</a>
				</li>
				{%endfor%}
			</ul>
			{% endif %}
        </li>
		<li id="postbypost" class="widget widget_interjccategoryposts">
		    <h2>热门文章</h2>
			<ul class ="sidemenu">
			{% for entry in blog.hotposts %}
				<li><a href="/{{entry.link|escape}}" title="{{entry.title|escape}}">{{entry.title|escape}}({{entry.readtimes}})</a>
				</li>
				{%endfor%}
			</ul>
		</li>
		<div id="recentcomments" class="widget widget_recent_comments">
			<h2>最近评论</h2>
{% for comment in recent_comments %}
<li class="rc_item">
<div class="rc_avatar"><img alt="" src="{{comment.gravatar_url}}" class="avatar avatar-32 photo" height="32" width="32"></div>
<div class="rc_info"><span class="author_name">{%if comment.weburl %}<a target="_blank" href="{{comment.weburl}}" class="url" rel="external nofollow">{{comment.author}}</a>{% else %}{{comment.author}}{%endif%} </span>#{{comment.date|datetz:"M d, Y"}}</div>
<div class="rc_excerpt"><a href="/{{comment.entry.link|escape}}#comment-{{comment.key.id}}">{{comment.shortcontent}}...</a></div>
</li>

{%endfor%}
		</div>
		<li id = "tag_cloud" class="widget widget_tag_cloud">
			<h2>标签云</h2>
			<ul>
				<li>
				{% if alltags %}
				{% for t in alltags %}
				<a style="font-size:{{ t.tagcount|add:9 }}px;" title="{{ t.tagcount }} pages of {{t.tag}}" 
							href="/tag/{{t.tag|urlencode}}">{{t.tag}}</a>
				{%endfor%}
				{% endif %}
				</li>
			</ul>
		</li>
	<!-- color tag -->
	<script type="text/javascript">
        $(".widget_tag_cloud li a").each(function (i) {
            this.style.color = randomColor()
        });
        function randomColor() {
            var arrHex = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"];
            var strHex = "#";
            var index;
            for (var i = 0; i < 6; i++) {
                index = Math.round(Math.random() * 15);
                strHex += arrHex[index];
            }
            return strHex;
        }
	</script>


		<li id = "tag_cloud"class="widget_tag_category">
			<h2>分类</h2>
			<ul>
			{%for cate in categories%}
				<li class="cat-item cat-item-846">
					<a href="/category/{{cate.slug}}"title = "{{cate.name}}">{{cate.name}}({{cate.count}})</a>
				</li>
				{%endfor%}
			</ul>
		</li>
		<li id="meta-3" class="widget widget_meta">
		<h2>快速连接</h2>
		<ul id="langpref" class = "smallmenu">        
				<script type="text/javascript">

					function loginp()
					{
					   $.getJSON("/do/info_login", function(ret){
							  if( ret.islogin)
							  {
								  html='<li><a href="{{self.logouturl}}">登出</a></li>';
								if (ret.isadmin)
								html+=' <li><a href="/admin">管理</a></li>';
								$('#langpref').html(html);

							  }
							  else
							  {$('#langpref').html('<li><a href="/admin">登陆</a></li>');}
					   });
					}
					loginp();
				</script>
		</ul>
		<ul>
						<li>
					<a href="{{ blog.feedurl }}" title="Please use RSS 2.0 to synch this content">Article <abbr title="Really Simple Syndication">RSS</abbr></a>
				</li>
				<li>
					<a rel="nofollow" href="/sitemap">Sitemap</a>
				</li>
		</ul>
		</li>

		
</ul>
</div>